Skip to main content

FormInstance

The FormInstance class manages a form instance, providing properties and methods for handling form settings, secrets, user events, deployment URL configurations, and controls. It integrates encryption and decryption for secure management of SecretKey and other sensitive data.

Properties

NameDescription
FormNameThe name of the form associated with this instance.
ClientFormRepresents the client form data model linked to this form instance.
UserEventHolds the user event information relevant to this form instance.
ProjectNameThe name of the project associated with this form instance.
ControlsA collection of form controls associated with this form instance, excluding JSON serialization.
SecretKeyHandles the encrypted secret key for the form, managing decryption and merging parameters if necessary.
VersionSpecifies the version of the form, with a default value of "latest".
AgentModeIndicates if the form operates in agent mode, adjusting behavior and URL configurations for agent-based resources.
ParametersContains a collection of parameters used within the form instance, initialized as an empty dictionary.
DeploymentUrlGenerates the deployment URL based on AgentMode, using a formatted string if agent mode is active, otherwise returning the standard deployment URL.
SecretObjectDecrypts and returns the FormSecret object associated with the current SecretKey.

Constructors

NameDescription
FormInstance(projectName, formName, secretKey)Creates a new form instance with the specified parameters.
FormInstance(projectName, formName, secretKey, agentMode, serviceAPI)Creates a new form instance with the specified parameters.
FormInstance(projectName, formName, serviceAPI)Creates a new form instance with the specified parameters.
FormInstance(projectName, formName, secretKey, serviceAPI)Creates a new form instance with the specified parameters.

Methods

NameDescription
GetRelatedDocumentObjects(objectIds, telemetryCollectorHolder)Retrieves a list of related document objects based on the provided object IDs.
BatchCreateWithDocumentData(documentsData, telemetryCollectorHolder)Creates multiple form instances with the provided list of document data.
SetControlValue(key, value , telemetryCollectorHolder)Sets the value of a specific control in the form instance.
Save(telemetryCollectorHolder)Saves the form instance by calling the SaveForm method.
UpdateStatus(documentId, status, telemetryCollectorHolder)Updates the status of a document based on the provided document ID and status.
MergeData(controlValues, telemetryCollectorHolder)Merges the provided control values into the form instance controls.
Release(formStateId, telemetryCollectorHolder)Releases the specified form state by its ID.
Initialize(createForm, telemetryCollectorHolder)Initializes the form instance, optionally creating the form if specified.
SetUniqueId(documentId, uniqueId, telemetryCollectorHolder)Sets a unique ID for the specified document.
SetFormInstanceIntialParameters(serviceAPI, telemetryCollectorHolder)Sets the initial parameters for the form instance by initializing the FormManagerAPI and ServiceAPI properties and loading the necessary initial parameters.
GetFileSelectorObjects(objectIds, telemetryCollectorHolder)Retrieves a list of file selector objects based on the provided object IDs.
CheckColumnsIsUnique(documentId, controlName, rows, telemetryCollectorHolder)Checks whether the specified columns are unique in the provided grid data.
GetControlValue(documentId, controlName, telemetryCollectorHolder)Retrieves the value of a specific control in the form instance.
DeleteDocument(documentId, telemetryCollectorHolder)Deletes a document based on the provided document ID.
GetRelatedDocumentObjectsV2(objectRequestSecretKeys, telemetryCollectorHolder)Retrieves a list of related document objects based on the provided secret keys for object requests.
SaveAsDraft(starterInfo, telemetryCollectorHolder)Saves the form instance as a draft by calling the SaveAsDraftForm method.
CreateWithDocumentData(documentData, telemetryCollectorHolder)Creates a form instance with the provided document data.
InitializeWithoutView(telemetryCollectorHolder)Initializes the form instance without creating a view, performing necessary initializations.
Run(telemetryCollectorHolder)Executes the form instance by calling the RunForm method.
GetFileSelectorObjectsV2(objectRequestSecretKeys, telemetryCollectorHolder)Retrieves a list of file selector objects based on the provided object request secret keys.